********************************************************************************
** Export statistics for 1924
tempfile crops1924 crops1900


import excel "Grid Africa\Files\Cash_crops_africa_1900_1924.xlsx", sheet("Exports") firstrow case(lower) clear
rename cntr_desc col

replace col="EFG" if col=="Etablissements Francaises du Golfe de Guinee"
replace col="COA" if col=="Cote Occidentale d'Afrique"

replace cash_crop="cocoa" if cash_crop=="Cocoa"
replace cash_crop="cocoa" if cash_crop=="Cocoa: fat and oil"
replace cash_crop="coffee" if cash_crop=="Coffee"
replace cash_crop="cotton" if cash_crop=="Cotton: not carded or combed (ginned)"
replace cash_crop="cotton" if cash_crop=="Cotton: raw"
replace cash_crop="groundnuts" if cash_crop=="Groundnuts"
replace cash_crop="oilpalm" if cash_crop=="Oil seeds"
replace cash_crop="oilpalm" if cash_crop=="Palm kernels"
replace cash_crop="oilpalm" if cash_crop=="Palm oil"
replace cash_crop="tea" if cash_crop=="Tea"
replace cash_crop="tobacco" if cash_crop=="Tobacco: unmanufactured"
drop if cash_crop=="Oleaginous fruits"

gen value1924=uvx*qm // generate export value 
collapse (sum) value, by(col cash_crop year) // col year duplicates because of oil palm and palm kernel
keep col year cash_crop value

reshape wide value1924, i(col year) j(cash_crop) string // shape cash crops from row to column

drop if year==1900
drop year

** Add export statistics for Angola, Mozambique, and Belgium Congo
insobs 1
replace col="Angola" if col==""
replace value1924cotton=35467 if col=="Angola" // taken from export statistics, cite Kleoniki
replace value1924coffee=266599 if col=="Angola" // taken from export statistics, cite Kleoniki
insobs 1
replace col="Mozambique" if col==""
replace value1924cotton=137680 if col=="Mozambique" // taken from export statistics, cite Kleoniki
insobs 1
replace col="DRC" if col==""
replace value1924cotton=298285 if col=="DRC" // Despite no series available for Belgian Congo I found a source that displays the exports 1925-38. But its an index – not values given for every year (so impossible to reconstruct for years in which we don’t know the total value of exports). However, the value and total share was given for copper in 1930 and 1932, based on this I worked out the revenues of cotton and palm oil in years 1930. Then I found in another source the export value of copper, which allowed me to work out the value of all export items of British Congo in 1925 in British Pounds… 
replace value1924oilpalm=3430276 if col=="DRC"


** Separate Kenya and Uganda Protectorate into i) coffee in Kenya and ii)cotton in Uganda
expand 2 if col=="Kenya and Uganda Protectorate" // add an observation
sort col
replace col="Kenya" if col=="Kenya and Uganda Protectorate" & col[_n-1]=="Kenya and Uganda Protectorate"
replace col="Uganda" if col=="Kenya and Uganda Protectorate"
replace value1924cotton=0 if col=="Kenya"
replace value1924coffee=0 if col=="Uganda"

* Add export statistics for former German colonies (Trusteeships) Togo and Cameroon
insobs 1
replace col="Togo" if col==""
* replace value1924rubber=853.45 if col=="Togo" // no rubber GAEZ index 
replace value1924coffee=111.33 if col=="Togo"
replace value1924cotton=2160.16 if col=="Togo"
replace value1924oilpalm=282273.01 if col=="Togo"
replace value1924cocoa=181886.42 if col=="Togo"
// subtract Togo export values from EFG (because EFG comprises Benin AND Togo) - for 1924 only?
replace value1924coffee=value1924coffee-111.33 if col=="EFG"
replace value1924cotton=value1924cotton-2160.16 if col=="EFG"
replace value1924oilpalm=value1924oilpalm-282273.01 if col=="EFG"

insobs 1
replace col="Cameroon" if col==""
* replace value1924rubber=10268.64 if col=="Cameroon" // no rubber GAEZ index 
replace value1924cotton=136.64 if col=="Cameroon"
replace value1924cocoa=47239.88 if col=="Cameroon"
replace value1924oilpalm=347529.29 if col=="Cameroon"
replace value1924tobacco=965.08 if col=="Cameroon"

* Add export statistics for Ruanda-Urundi
insobs 1
replace col="Ruanda-Urundi" if col==""
replace value1924coffee=. if col=="Ruanda-Urundi" // 22 tonnes exported but not value given. Neglibible value anyways. 
replace value1924oilpalm=5150.15 if col=="Ruanda-Urundi"
replace value1924tobacco=84.08 if col=="Ruanda-Urundi"

save "Grid Africa\Files\crops1924.dta", replace


********************************************************************************
** Export statistics for 1900

import excel "Grid Africa\Files\Cash_crops_africa_1900_1924.xlsx", sheet("Exports") firstrow case(lower) clear
rename cntr_desc col

replace col="EFG" if col=="Etablissements Francaises du Golfe de Guinee"
replace col="COA" if col=="Cote Occidentale d'Afrique"

replace cash_crop="cocoa" if cash_crop=="Cocoa"
replace cash_crop="cocoa" if cash_crop=="Cocoa: fat and oil"
replace cash_crop="coffee" if cash_crop=="Coffee"
replace cash_crop="cotton" if cash_crop=="Cotton: not carded or combed (ginned)"
replace cash_crop="cotton" if cash_crop=="Cotton: raw"
replace cash_crop="groundnuts" if cash_crop=="Groundnuts"
replace cash_crop="oilpalm" if cash_crop=="Oil seeds"
replace cash_crop="oilpalm" if cash_crop=="Palm kernels"
replace cash_crop="oilpalm" if cash_crop=="Palm oil"
replace cash_crop="tea" if cash_crop=="Tea"
replace cash_crop="tobacco" if cash_crop=="Tobacco: unmanufactured"
drop if cash_crop=="Oleaginous fruits"

gen value1900=uvx*qm // generate export value 
collapse (sum) value, by(col cash_crop year) // col year duplicates because of oil palm and palm kernel
keep col year cash_crop value

reshape wide value1900, i(col year) j(cash_crop) string // shape cash crops from row to column

drop if year==1924
drop year

** Add export statistics for Angola, Mozambique, and Belgium Congo
insobs 1
replace col="Angola" if col==""
* replace value1900rubber=102071 if col=="Angola" // no rubber GAEZ index
replace value1900coffee=102071 if col=="Angola" 
insobs 1
replace col="Mozambique" if col==""
* replace value1900rubber=244336 if col=="Mozambique" // no rubber GAEZ index 
insobs 1
replace col="DRC" if col==""
* replace value1900rubber=1745022 if col=="DRC" // no rubber GAEZ index 
replace value1900oilpalm=86343 if col=="DRC"
replace value1900cocoa=244 if col=="DRC"
replace value1900tobacco=64 if col=="DRC"
replace value1900coffee=2454 if col=="DRC"

* Add export statistics for German colonies Togo, Cameroon and Tanganyika
insobs 1
replace col="Tanganyika" if col==""
* replace value1900rubber=48494.02776 if col=="Tanganyika" // no rubber GAEZ index 
replace value1900coffee=12032.33 if col=="Tanganyika"
insobs 1
replace col="Togo" if col==""
* replace value1900rubber=17905.66412 if col=="Togo" // no rubber GAEZ index 
replace value1900oilpalm=101036.4669 if col=="Togo"
replace value1900groundnuts=474.5985358 if col=="Togo"
insobs 1
replace col="Cameroon" if col==""
* replace value1900rubber=78277.2098 if col=="Cameroon" // no rubber GAEZ index 
replace value1900oilpalm=108364.4483 if col=="Cameroon"
replace value1900cocoa=14534.17051 if col=="Cameroon"
replace value1900coffee=19.07589704 if col=="Cameroon"

* Add export statistics for German colonies Kenya and Uganda from 1901 Blue Books
insobs 1
replace col="Kenya" if col==""
* replace value1900rubber=8152 if col=="Kenya" // no rubber GAEZ index 
replace value1900coffee=19.07589704 if col=="Kenya"
replace value1900tobacco=590 if col=="Kenya"
insobs 1
replace col="Uganda" if col==""
* replace value1900rubber=3432 if col=="Uganda" // no rubber GAEZ index 
replace value1900coffee=892 if col=="Uganda"

save "Grid Africa\Files\crops1900.dta", replace
